package com.huawei.mytestapp.lib;

import ohos.agp.components.AttrSet;
import ohos.agp.components.Component;
import ohos.agp.components.Image;
import ohos.agp.render.Canvas;
import ohos.agp.render.Paint;
import ohos.agp.utils.RectFloat;
import ohos.app.Context;

public class test  extends Component implements Component.DrawTask {
    public test(Context context, AttrSet attrSet) {
        super(context, attrSet);
        init();
    }
    public test(Context context) {
        super(context);
        init();
    }

    public test(Context context, AttrSet attrSet, String styleName) {
        super(context, attrSet, styleName);
        init();
    }

    @Override
    public void onDraw(Component component, Canvas canvas) {
        canvas.drawRect(new RectFloat(0,0,1000,300),new Paint());
    }
    public void init()
    {
        this.addDrawTask(this,1);

    }
}
